package com.ajax.test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sql.edit;

/**
 * Servlet implementation class editServlet
 */
public class editServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8"); 
		response.setContentType("text/html");

		String name = request.getParameter("name");
		String pass = request.getParameter("pass");
		
		edit m = new edit();
		
//	   if(edit.Query(name)==1){
//		   json = "success";
//	   }else{
//		   json = "fail";
//	   }
		String s = edit.Query(name);
		PrintWriter out = response.getWriter();
		out.println(s);

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setCharacterEncoding("utf-8");
	//	System.out.println("AjaxServlet.doPost()");
		
		this.doGet(request, response);
	}


}
